package edu.hawaii.wattdepotapps;

import org.apache.wicket.Page;
import org.apache.wicket.markup.html.CSSPackageResource;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.link.Link;
import edu.hawaii.wattdepotapps.home.WattDepotAppsPage;
import edu.hawaii.wattdepotapps.visualizer.VisualizationPage; 
//import edu.hawaii.wattdepotapps.browser.BrowserPage;
import edu.hawaii.wattdepotapps.monitor.MonitorPage;

/**
 * Contains the class for the BasePage.html. Displays the main header and links to the other
 * applications being developed.
 * 
 * @author Edward Meyer, Kendyll Doi, Bao Huy Ung
 * @version 2.0
 */
public class BasePage extends WebPage {

  /**
   * Makes the page serializable.
   */
  private static final long serialVersionUID = -5719619758599534459L;

  /**
   * Calls the create method for the base page layout.
   * 
   */
  public BasePage() {
    createPage(this.getPage());
    // Mount the BasePage's CSS through Wicket.
    add(CSSPackageResource.getHeaderContribution(BasePage.class, "BasePage.css"));
  }

  /**
   * Creates the BasePage.
   * 
   * @param page holds the BasePage object
   */
  private void createPage(Page page) {
    page.add(new Link<String>("HomePageButton") {
      private static final long serialVersionUID = 1L;

      /** Upon clicking this link, go to Home Page. */
      @Override
      public void onClick() {
        setResponsePage(WattDepotAppsPage.class);
      }

    });

    // Adds the Visualizer button to the page and sets the current accordingly when button is
    // clicked.
    page.add(new Link<String>("VisualizationPageButton") {
      private static final long serialVersionUID = 1L;

      /** Upon clicking this link, go to Visualizer Page. */
      @Override
      public void onClick() {

        setResponsePage(VisualizationPage.class);
      }
    });

    // Adds the Browser button to the page and sets the current accordingly when button is
    // clicked.
    // page.add(new Link<String>("BrowserPageButton") {
    // private static final long serialVersionUID = 1L;

    // /** Upon clicking this link, go to Visualizer Page. */
    // @Override
    // public void onClick() {

    // setResponsePage(BrowserPage.class);
    // }
    // });

    // Adds the Monitor button to the page and sets the current accordingly when button is
    // clicked.
    page.add(new Link<String>("MonitorPageButton") {
      private static final long serialVersionUID = 1L;

      /** Upon clicking this link, go to Monitor Page. */
      @Override
      public void onClick() {

        setResponsePage(MonitorPage.class);
      }
    });
  }
}
